#define _CRT_SECURE_NO_WARNINGS 1
#include<bits/stdc++.h>
using namespace std;
//http://www.oj7.cn/
int currency[5001];
int total;
int N;
long long dp[1000][5001] = { 1 };
int main()
{
	int ans = 0;
	int sum=0;
	cin >> N >> total;
	for (int i =1 ;i<=N; i++)
	{
		cin >> currency[i];
	}
	for (int i = 1; i <=N; i++)
	{
		for (int j = 0; j <=total; j++)
		{
			for (int k = 0; k*currency[i]<=j; k++)
			{
				dp[i][j] +=  dp[i-1][j - k * currency[i]];
			}
		}
	}
	cout << dp[N][total]<<endl;
	return 0;
}